package models

import (
	"sync"
)

/**
 * @File : messageUrl.go
 * @Description : 信息url模型
 * @Author : chen
 * @Date : 2024/4/17
 */

// url 存储
type MessageUrlList struct {
	mutex sync.Mutex
	list  []string
}

// 添加 url
func (url *MessageUrlList) Add(urlList []string) {
	url.mutex.Lock()
	defer url.mutex.Unlock()
	url.list = append(url.list, urlList...)
}

// 获取长度
func (url *MessageUrlList) GetLen() (l int) {
	l = len(url.list)
	return
}

// 获取 url
func (url *MessageUrlList) GetList() (urlList []string) {
	urlList = url.list
	return
}
